import { defineStore } from 'pinia'

export const useStore = defineStore('store', {
  state: () => {
    return {
      address: localStorage.getItem('address') || '',
    }
  },
  getters: {},
  actions: {
    setAddress(newAddress: string) {
      this.address = newAddress // 更新存储中的地址
      localStorage.setItem('address', newAddress) // 更新 localStorage
    },
  },
})
